#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,t[100010],sum=0,maxn=-1,y[100010];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    fill(t,t+100001,0);
    for(int i=1;i<=n;i++) 
    {
        int m;
        scanf("%d",&m);
        t[m]++;
        maxn=max(maxn,m);
    }
    int cnt=0;
    for(int i=1;i<=maxn;i++)
    {
        if(t[i]) 
        {
            cnt++;
            y[cnt]=i;
        }
    }
    for(int i=1;i<=cnt;i++)
    {
        int o=t[y[i]]-t[y[i+1]];
        if(o>0) sum+=o;
    }
    printf("%d",sum);
    fclose(stdin);
    fclose(stdout);
    return 0;
}